<!DOCTYPE html>
<html>

  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<meta http-equiv="Cache-Control" content="no-siteapp" />

    <title>Plugin Development</title>
    <meta name="description" content="  Plugin Development          Introduction      Quick Start      Note: This documents is only a mirror, if you want to see newest documents please goto: http...">

    
    <meta name="keywords" content="xmake,docs,plugin,tboox" /> 

    <!-- qq oauth -->
    <meta property="qc:admins" content="5211601217706727767255" />

    <!--icon -->
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
    <link rel="icon" sizes="192x192" href="/static/img/nice-highres.png" />
	<link rel="apple-touch-icon-precomposed" href="/static/img/apple-touch-icon-57x57-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/static/img/apple-touch-icon-72x72-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/static/img/apple-touch-icon-114x114-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/static/img/apple-touch-icon-144x144-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="180x180" href="/static/img/retinahd_icon.png" />
	<meta name="msapplication-TileImage" content="/static/img/retinahd_icon.png" />
	
    <link rel="stylesheet" href=" /css/fontawesome/css/font-awesome.min.css ">
    <link rel="stylesheet" href=" /css/main.css ">
    <link rel="canonical" href="https://tboox.org/docs/xmake/plugins/">
    <link rel="alternate" type="application/rss+xml" title="TBOOX Open Source Project" href="https://tboox.org/feed.xml ">
    <link rel="alternate" hreflang="en" href="https://tboox.org/" />
    <link rel="alternate" hreflang="zh-Hans" href="https://tboox.org/cn/" />




    <script type="text/javascript">
    function isPC(){    
        var userAgentInfo = navigator.userAgent;  
        var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod");    
        var flag = true;    
        for (var v = 0; v < Agents.length; v++) {    
            if (userAgentInfo.indexOf(Agents[v]) > 0) { flag = false; break; }    
        }    
        return flag;    
    }
    </script>

<!-- baidu ads -->



    <!-- baidu ads -->

</head>


  <body>

    <header id="top">
    <div class="wrapper">
        <a href="/" class="brand">TBOOX</a>
        <button id="headerMenu" class="menu"><i class="fa fa-bars"></i></button>
        <nav id="headerNav">
            <ul>
                <li>
                    
                    <a href="/cn?lang=0">
                    
                        <i class="fa fa-home"></i>中文
                    </a>
                </li>

                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="/project/">
                            
                        
                            <i class="fa fa-bookmark"></i>Projects
                        </a>
                    </li>
                    
                    
                    
                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="/archive/">
                            
                        
                            <i class="fa fa-archive"></i>Archives
                        </a>
                    </li>
                    
                    
                    
                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="/category/">
                            
                        
                            <i class="fa fa-th-list"></i>Categories
                        </a>
                    </li>
                    
                    
                    
                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="/tag/">
                            
                        
                            <i class="fa fa-tags"></i>Tags
                        </a>
                    </li>
                    
                    
                    
                
                    
                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="/docs/">
                            
                        
                            <i class="fa fa-book"></i>Documents
                        </a>
                    </li>
                    
                    
                    
                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="https://xmake.io/#/about/contact" target="_blank" >
                            
                        
                            <i class="fa fa-forumbee"></i>Community
                        </a>
                    </li>
                    
                    
                    
                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="/donation/">
                            
                        
                            <i class="fa fa-heart"></i>Donate
                        </a>
                    </li>
                    
                    
                    
                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="/about/">
                            
                        
                            <i class="fa fa-user"></i>About
                        </a>
                    </li>
                    
                    
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                     
                     
                    
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            </ul>
        </nav>
    </div>
</header>



        <div class="page clearfix" post>
    <div class="left">
        <h1>Plugin Development</h1>
        <div class="label">

            <div class="label-card">
                <i class="fa fa-calendar"></i>2000-02-22
            </div>

            <div class="label-card">
                
            </div>

            <div class="label-card">
                
            </div>

            <div class="label-card">
            


<!-- <span class="point">•</span> -->
<span class="categories">
  <i class="fa fa-th-list"></i>
  
    
        <a href="/category/#xmake" title="Category: xmake" rel="category">xmake</a>
    
  

  <!-- <span class="point">•</span> -->
</span>


            </div>

            <div class="label-card">
            
<!-- <span class="point">•</span> -->
<span class="pageTag">
  <i class="fa fa-tags"></i>
  
    
        <!--a href="/tag/#xmake" title="Tag: xmake" rel="tag">xmake</a-->
        <a href="/tag/#xmake" title="Tag: xmake" rel="tag">xmake</a>&nbsp;
    
        <!--a href="/tag/#docs" title="Tag: docs" rel="tag">docs</a-->
        <a href="/tag/#docs" title="Tag: docs" rel="tag">docs</a>&nbsp;
    
        <!--a href="/tag/#plugin" title="Tag: plugin" rel="tag">plugin</a-->
        <a href="/tag/#plugin" title="Tag: plugin" rel="tag">plugin</a>
    
  

</span>

            </div>

        </div>
        <hr>
        <article itemscope itemtype="http://schema.org/BlogPosting">
        <ul id="markdown-toc">
  <li><a href="#plugin-development" id="markdown-toc-plugin-development">Plugin Development</a>    <ul>
      <li><a href="#introduction" id="markdown-toc-introduction">Introduction</a></li>
      <li><a href="#quick-start" id="markdown-toc-quick-start">Quick Start</a></li>
      <li><a href="#run-plugin" id="markdown-toc-run-plugin">Run Plugin</a></li>
    </ul>
  </li>
  <li><a href="#builtin-plugins" id="markdown-toc-builtin-plugins">Builtin Plugins</a>    <ul>
      <li><a href="#macros-recording-and-playback" id="markdown-toc-macros-recording-and-playback">Macros Recording and Playback</a>        <ul>
          <li><a href="#introduction-1" id="markdown-toc-introduction-1">Introduction</a></li>
          <li><a href="#record-commands" id="markdown-toc-record-commands">Record Commands</a></li>
          <li><a href="#playback-macro" id="markdown-toc-playback-macro">Playback Macro</a></li>
          <li><a href="#named-macro" id="markdown-toc-named-macro">Named Macro</a></li>
          <li><a href="#import-and-export-macro" id="markdown-toc-import-and-export-macro">Import and Export Macro</a></li>
          <li><a href="#list-and-show-macro" id="markdown-toc-list-and-show-macro">List and Show Macro</a></li>
          <li><a href="#custom-macro-script" id="markdown-toc-custom-macro-script">Custom Macro Script</a></li>
          <li><a href="#builtin-macros" id="markdown-toc-builtin-macros">Builtin Macros</a></li>
          <li><a href="#advance-macro-script" id="markdown-toc-advance-macro-script">Advance Macro Script</a></li>
        </ul>
      </li>
      <li><a href="#run-the-custom-lua-script" id="markdown-toc-run-the-custom-lua-script">Run the Custom Lua Script</a>        <ul>
          <li><a href="#run-the-given-script" id="markdown-toc-run-the-given-script">Run the given script</a></li>
          <li><a href="#run-the-builtin-script" id="markdown-toc-run-the-builtin-script">Run the builtin script</a></li>
          <li><a href="#run-interactive-commands-repl" id="markdown-toc-run-interactive-commands-repl">Run interactive commands (REPL)</a></li>
        </ul>
      </li>
      <li><a href="#generate-ide-project-files" id="markdown-toc-generate-ide-project-files">Generate IDE Project Files</a>        <ul>
          <li><a href="#generate-makefile" id="markdown-toc-generate-makefile">Generate Makefile</a></li>
          <li><a href="#generate-compiler_commands" id="markdown-toc-generate-compiler_commands">Generate compiler_commands</a></li>
          <li><a href="#generate-visualstudio-project" id="markdown-toc-generate-visualstudio-project">Generate VisualStudio Project</a></li>
        </ul>
      </li>
      <li><a href="#generate-doxygen-document" id="markdown-toc-generate-doxygen-document">Generate Doxygen Document</a></li>
    </ul>
  </li>
  <li><a href="#more-plugins" id="markdown-toc-more-plugins">More Plugins</a>    <ul>
      <li><a href="#convert-app-to-ipa" id="markdown-toc-convert-app-to-ipa">Convert .app to .ipa</a></li>
    </ul>
  </li>
</ul>

<p>Note: This documents is only a mirror, if you want to see newest documents please goto: <a href="http://xmake.io/#/plugins">http://xmake.io/#/plugins</a></p>

<h2 id="plugin-development">Plugin Development</h2>

<h4 id="introduction">Introduction</h4>

<p>XMake supports the plugin module and we can develop ourself plugin module conveniently.</p>

<p>We can run command <code class="highlighter-rouge">xmake -h</code> to look over some builtin plugins of xmake</p>

<div class="highlighter-rouge"><pre class="highlight"><code>Plugins: 
    l, lua                                 Run the lua script.
    m, macro                               Run the given macro.
       doxygen                             Generate the doxygen document.
       hello                               Hello xmake!
       project                             Create the project file.
</code></pre>
</div>

<ul>
  <li>lua: Run a given lua script.</li>
  <li>macro: Record and playback some xmake commands repeatly.</li>
  <li>doxygen：Generate doxygen document automatically.</li>
  <li>hello:  The demo plugin and only print: ‘hello xmake!’</li>
  <li>project：Generate project file for IDE, only generate makefile now and will generate vs, xcode project in the future</li>
</ul>

<h4 id="quick-start">Quick Start</h4>

<p>Now we write a simple plugin demo for printing ‘hello xmake!’</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="c1">-- define a plugin task </span>
<span class="n">task</span><span class="p">(</span><span class="s2">"hello"</span><span class="p">)</span>

    <span class="c1">-- set the category for showing it in plugin category menu (optional)</span>
    <span class="n">set_category</span><span class="p">(</span><span class="s2">"plugin"</span><span class="p">)</span>

    <span class="c1">-- the main entry of the plugin</span>
    <span class="n">on_run</span><span class="p">(</span><span class="k">function</span> <span class="p">()</span>

        <span class="c1">-- print 'hello xmake!'</span>
        <span class="nb">print</span><span class="p">(</span><span class="s2">"hello xmake!"</span><span class="p">)</span>
    <span class="k">end</span><span class="p">)</span>

    <span class="c1">-- set the menu options, but we put empty options now.</span>
    <span class="n">set_menu</span> <span class="p">{</span>
                <span class="c1">-- usage</span>
                <span class="n">usage</span> <span class="o">=</span> <span class="s2">"xmake hello [options]"</span>

                <span class="c1">-- description</span>
            <span class="p">,</span>   <span class="n">description</span> <span class="o">=</span> <span class="s2">"Hello xmake!"</span>

                <span class="c1">-- options</span>
            <span class="p">,</span>   <span class="n">options</span> <span class="o">=</span> <span class="p">{}</span>
            <span class="p">}</span>
</code></pre>
</div>

<p>The file tree of this plugin:</p>

<div class="highlighter-rouge"><pre class="highlight"><code>hello
 - xmake.lua

</code></pre>
</div>

<p>Now one of the most simple plugin finished, how was it to be xmake detected it, there are three ways:</p>

<ol>
  <li>Put this plugin directory into xmake/plugins the source codes as the builtin plugin.</li>
  <li>Put this plugin directory into ~/.xmake/plugins as the global user plugin.</li>
  <li>Put this plugin directory to anywhere and call <code class="highlighter-rouge">add_plugindirs("./hello")</code> in xmake.lua as the local project plugin.</li>
</ol>

<h4 id="run-plugin">Run Plugin</h4>

<p>Next we run this plugin</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code>xmake hello
</code></pre>
</div>

<p>The results is</p>

<div class="highlighter-rouge"><pre class="highlight"><code>hello xmake!
</code></pre>
</div>

<p>Finally, we can also run this plugin in the custom scripts of <code class="highlighter-rouge">xmake.lua</code></p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code>
<span class="n">target</span><span class="p">(</span><span class="s2">"demo"</span><span class="p">)</span>
    
    <span class="c1">-- run this plugin after building target</span>
    <span class="n">after_build</span><span class="p">(</span><span class="k">function</span> <span class="p">(</span><span class="n">target</span><span class="p">)</span>
  
        <span class="c1">-- import task module</span>
        <span class="n">import</span><span class="p">(</span><span class="s2">"core.project.task"</span><span class="p">)</span>

        <span class="c1">-- run the plugin task</span>
        <span class="n">task</span><span class="p">.</span><span class="n">run</span><span class="p">(</span><span class="s2">"hello"</span><span class="p">)</span>
    <span class="k">end</span><span class="p">)</span>
</code></pre>
</div>

<h2 id="builtin-plugins">Builtin Plugins</h2>

<h4 id="macros-recording-and-playback">Macros Recording and Playback</h4>

<h5 id="introduction-1">Introduction</h5>

<p>We can record and playback our xmake commands and save as macro quickly using this plugin.</p>

<p>And we can run this macro to simplify our jobs repeatly.</p>

<h5 id="record-commands">Record Commands</h5>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="c"># begin to record commands</span>
<span class="gp">$ </span>xmake macro --begin

<span class="c"># run some xmake commands</span>
<span class="gp">$ </span>xmake f -p android --ndk<span class="o">=</span>/xxx/ndk -a armv7-a
<span class="gp">$ </span>xmake p
<span class="gp">$ </span>xmake f -p mingw --sdk<span class="o">=</span>/mingwsdk
<span class="gp">$ </span>xmake p
<span class="gp">$ </span>xmake f -p linux --sdk<span class="o">=</span>/toolsdk --toolchains<span class="o">=</span>/xxxx/bin
<span class="gp">$ </span>xmake p
<span class="gp">$ </span>xmake f -p iphoneos -a armv7
<span class="gp">$ </span>xmake p
<span class="gp">$ </span>xmake f -p iphoneos -a arm64
<span class="gp">$ </span>xmake p
<span class="gp">$ </span>xmake f -p iphoneos -a armv7s
<span class="gp">$ </span>xmake p
<span class="gp">$ </span>xmake f -p iphoneos -a i386
<span class="gp">$ </span>xmake p
<span class="gp">$ </span>xmake f -p iphoneos -a x86_64
<span class="gp">$ </span>xmake p

<span class="c"># stop to record and  save as anonymous macro</span>
xmake macro --end 
</code></pre>
</div>

<h5 id="playback-macro">Playback Macro</h5>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="c"># playback the previous anonymous macro</span>
<span class="gp">$ </span>xmake macro .
</code></pre>
</div>

<h5 id="named-macro">Named Macro</h5>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake macro --begin
<span class="gp">$ </span>...
<span class="gp">$ </span>xmake macro --end macroname
<span class="gp">$ </span>xmake macro macroname
</code></pre>
</div>

<h5 id="import-and-export-macro">Import and Export Macro</h5>

<p>Import the given macro file or directory.</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake macro --import<span class="o">=</span>/xxx/macro.lua macroname
<span class="gp">$ </span>xmake macro --import<span class="o">=</span>/xxx/macrodir
</code></pre>
</div>

<p>Export the given macro to file or directory.</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake macro --export<span class="o">=</span>/xxx/macro.lua macroname
<span class="gp">$ </span>xmake macro --export<span class="o">=</span>/xxx/macrodir
</code></pre>
</div>

<h5 id="list-and-show-macro">List and Show Macro</h5>

<p>List all builtin macros.</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake macro --list
</code></pre>
</div>

<p>Show the given macro script content.</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake macro --show macroname
</code></pre>
</div>

<h5 id="custom-macro-script">Custom Macro Script</h5>

<p>Create and write a <code class="highlighter-rouge">macro.lua</code> script first.</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="k">function</span> <span class="nf">main</span><span class="p">()</span>
    <span class="n">os</span><span class="p">.</span><span class="n">exec</span><span class="p">(</span><span class="s2">"xmake f -p android --ndk=/xxx/ndk -a armv7-a"</span><span class="p">)</span>
    <span class="n">os</span><span class="p">.</span><span class="n">exec</span><span class="p">(</span><span class="s2">"xmake p"</span><span class="p">)</span>
    <span class="n">os</span><span class="p">.</span><span class="n">exec</span><span class="p">(</span><span class="s2">"xmake f -p mingw --sdk=/mingwsdk"</span><span class="p">)</span>
    <span class="n">os</span><span class="p">.</span><span class="n">exec</span><span class="p">(</span><span class="s2">"xmake p"</span><span class="p">)</span>
    <span class="n">os</span><span class="p">.</span><span class="n">exec</span><span class="p">(</span><span class="s2">"xmake f -p linux --sdk=/toolsdk --toolchains=/xxxx/bin"</span><span class="p">)</span>
    <span class="n">os</span><span class="p">.</span><span class="n">exec</span><span class="p">(</span><span class="s2">"xmake p"</span><span class="p">)</span>
    <span class="n">os</span><span class="p">.</span><span class="n">exec</span><span class="p">(</span><span class="s2">"xmake f -p iphoneos -a armv7"</span><span class="p">)</span>
    <span class="n">os</span><span class="p">.</span><span class="n">exec</span><span class="p">(</span><span class="s2">"xmake p"</span><span class="p">)</span>
    <span class="n">os</span><span class="p">.</span><span class="n">exec</span><span class="p">(</span><span class="s2">"xmake f -p iphoneos -a arm64"</span><span class="p">)</span>
    <span class="n">os</span><span class="p">.</span><span class="n">exec</span><span class="p">(</span><span class="s2">"xmake p"</span><span class="p">)</span>
    <span class="n">os</span><span class="p">.</span><span class="n">exec</span><span class="p">(</span><span class="s2">"xmake f -p iphoneos -a armv7s"</span><span class="p">)</span>
    <span class="n">os</span><span class="p">.</span><span class="n">exec</span><span class="p">(</span><span class="s2">"xmake p"</span><span class="p">)</span>
    <span class="n">os</span><span class="p">.</span><span class="n">exec</span><span class="p">(</span><span class="s2">"xmake f -p iphoneos -a i386"</span><span class="p">)</span>
    <span class="n">os</span><span class="p">.</span><span class="n">exec</span><span class="p">(</span><span class="s2">"xmake p"</span><span class="p">)</span>
    <span class="n">os</span><span class="p">.</span><span class="n">exec</span><span class="p">(</span><span class="s2">"xmake f -p iphoneos -a x86_64"</span><span class="p">)</span>
    <span class="n">os</span><span class="p">.</span><span class="n">exec</span><span class="p">(</span><span class="s2">"xmake p"</span><span class="p">)</span>  
<span class="k">end</span>
</code></pre>
</div>

<p>Import this macro script to xmake.</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake macro --import<span class="o">=</span>/xxx/macro.lua <span class="o">[</span>macroname]
</code></pre>
</div>

<p>Playback this macro script.</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake macro <span class="o">[</span>.|macroname]
</code></pre>
</div>

<h5 id="builtin-macros">Builtin Macros</h5>

<p>XMake supports some builtins macros to simplify our jobs.</p>

<p>For example, we use <code class="highlighter-rouge">package</code> macro to package all architectures of the iphoneos platform just for once.</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake macro package -p iphoneos 
</code></pre>
</div>

<h5 id="advance-macro-script">Advance Macro Script</h5>

<p>Let’s see the <code class="highlighter-rouge">package</code> macro script:</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="c1">-- imports</span>
<span class="n">import</span><span class="p">(</span><span class="s2">"core.base.option"</span><span class="p">)</span>
<span class="n">import</span><span class="p">(</span><span class="s2">"core.project.config"</span><span class="p">)</span>
<span class="n">import</span><span class="p">(</span><span class="s2">"core.project.project"</span><span class="p">)</span>
<span class="n">import</span><span class="p">(</span><span class="s2">"core.platform.platform"</span><span class="p">)</span>

<span class="c1">-- the options</span>
<span class="kd">local</span> <span class="n">options</span> <span class="o">=</span>
<span class="p">{</span>
    <span class="p">{</span><span class="s1">'p'</span><span class="p">,</span> <span class="s2">"plat"</span><span class="p">,</span>       <span class="s2">"kv"</span><span class="p">,</span>  <span class="n">os</span><span class="p">.</span><span class="n">host</span><span class="p">(),</span>   <span class="s2">"Set the platform."</span>                                    <span class="p">}</span>
<span class="p">,</span>   <span class="p">{</span><span class="s1">'f'</span><span class="p">,</span> <span class="s2">"config"</span><span class="p">,</span>     <span class="s2">"kv"</span><span class="p">,</span>  <span class="kc">nil</span><span class="p">,</span>         <span class="s2">"Pass the config arguments to \"</span><span class="n">xmake</span> <span class="n">config</span><span class="err">\</span><span class="s2">" .."</span>     <span class="p">}</span>
<span class="p">,</span>   <span class="p">{</span><span class="s1">'o'</span><span class="p">,</span> <span class="s2">"outputdir"</span><span class="p">,</span>  <span class="s2">"kv"</span><span class="p">,</span>  <span class="kc">nil</span><span class="p">,</span>         <span class="s2">"Set the output directory of the package."</span>             <span class="p">}</span>
<span class="p">}</span>

<span class="c1">-- package all</span>
<span class="c1">--</span>
<span class="c1">-- .e.g</span>
<span class="c1">-- xmake m package </span>
<span class="c1">-- xmake m package -f "-m debug"</span>
<span class="c1">-- xmake m package -p linux</span>
<span class="c1">-- xmake m package -p iphoneos -f "-m debug --xxx ..." -o /tmp/xxx</span>
<span class="c1">-- xmake m package -f \"--mode=debug\"</span>
<span class="c1">--</span>
<span class="k">function</span> <span class="nf">main</span><span class="p">(</span><span class="n">argv</span><span class="p">)</span>

    <span class="c1">-- parse arguments</span>
    <span class="kd">local</span> <span class="n">args</span> <span class="o">=</span> <span class="n">option</span><span class="p">.</span><span class="n">parse</span><span class="p">(</span><span class="n">argv</span><span class="p">,</span> <span class="n">options</span><span class="p">,</span> <span class="s2">"Package all architectures for the given the platform."</span>
                                           <span class="p">,</span> <span class="s2">""</span>
                                           <span class="p">,</span> <span class="s2">"Usage: xmake macro package [options]"</span><span class="p">)</span>

    <span class="c1">-- package all archs</span>
    <span class="kd">local</span> <span class="n">plat</span> <span class="o">=</span> <span class="n">args</span><span class="p">.</span><span class="n">plat</span>
    <span class="k">for</span> <span class="n">_</span><span class="p">,</span> <span class="n">arch</span> <span class="k">in</span> <span class="nb">ipairs</span><span class="p">(</span><span class="n">platform</span><span class="p">.</span><span class="n">archs</span><span class="p">(</span><span class="n">plat</span><span class="p">))</span> <span class="k">do</span>

        <span class="c1">-- config it</span>
        <span class="n">os</span><span class="p">.</span><span class="n">exec</span><span class="p">(</span><span class="s2">"xmake f -p %s -a %s %s -c %s"</span><span class="p">,</span> <span class="n">plat</span><span class="p">,</span> <span class="n">arch</span><span class="p">,</span> <span class="n">args</span><span class="p">.</span><span class="n">config</span> <span class="ow">or</span> <span class="s2">""</span><span class="p">,</span> <span class="n">ifelse</span><span class="p">(</span><span class="n">option</span><span class="p">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"verbose"</span><span class="p">),</span> <span class="s2">"-v"</span><span class="p">,</span> <span class="s2">""</span><span class="p">))</span>

        <span class="c1">-- package it</span>
        <span class="k">if</span> <span class="n">args</span><span class="p">.</span><span class="n">outputdir</span> <span class="k">then</span>
            <span class="n">os</span><span class="p">.</span><span class="n">exec</span><span class="p">(</span><span class="s2">"xmake p -o %s %s"</span><span class="p">,</span> <span class="n">args</span><span class="p">.</span><span class="n">outputdir</span><span class="p">,</span> <span class="n">ifelse</span><span class="p">(</span><span class="n">option</span><span class="p">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"verbose"</span><span class="p">),</span> <span class="s2">"-v"</span><span class="p">,</span> <span class="s2">""</span><span class="p">))</span>
        <span class="k">else</span>
            <span class="n">os</span><span class="p">.</span><span class="n">exec</span><span class="p">(</span><span class="s2">"xmake p %s"</span><span class="p">,</span> <span class="n">ifelse</span><span class="p">(</span><span class="n">option</span><span class="p">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"verbose"</span><span class="p">),</span> <span class="s2">"-v"</span><span class="p">,</span> <span class="s2">""</span><span class="p">))</span>
        <span class="k">end</span>
    <span class="k">end</span>

    <span class="c1">-- package universal for iphoneos, watchos ...</span>
    <span class="k">if</span> <span class="n">plat</span> <span class="o">==</span> <span class="s2">"iphoneos"</span> <span class="ow">or</span> <span class="n">plat</span> <span class="o">==</span> <span class="s2">"watchos"</span> <span class="k">then</span>

        <span class="c1">-- load configure</span>
        <span class="n">config</span><span class="p">.</span><span class="n">load</span><span class="p">()</span>

        <span class="c1">-- load project</span>
        <span class="n">project</span><span class="p">.</span><span class="n">load</span><span class="p">()</span>

        <span class="c1">-- enter the project directory</span>
        <span class="n">os</span><span class="p">.</span><span class="n">cd</span><span class="p">(</span><span class="n">project</span><span class="p">.</span><span class="n">directory</span><span class="p">())</span>

        <span class="c1">-- the outputdir directory</span>
        <span class="kd">local</span> <span class="n">outputdir</span> <span class="o">=</span> <span class="n">args</span><span class="p">.</span><span class="n">outputdir</span> <span class="ow">or</span> <span class="n">config</span><span class="p">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"buildir"</span><span class="p">)</span>

        <span class="c1">-- package all targets</span>
        <span class="k">for</span> <span class="n">_</span><span class="p">,</span> <span class="n">target</span> <span class="k">in</span> <span class="nb">pairs</span><span class="p">(</span><span class="n">project</span><span class="p">.</span><span class="n">targets</span><span class="p">())</span> <span class="k">do</span>

            <span class="c1">-- get all modes</span>
            <span class="kd">local</span> <span class="n">modedirs</span> <span class="o">=</span> <span class="n">os</span><span class="p">.</span><span class="n">match</span><span class="p">(</span><span class="n">format</span><span class="p">(</span><span class="s2">"%s/%s.pkg/lib/*"</span><span class="p">,</span> <span class="n">outputdir</span><span class="p">,</span> <span class="n">target</span><span class="p">:</span><span class="n">name</span><span class="p">()),</span> <span class="kc">true</span><span class="p">)</span>
            <span class="k">for</span> <span class="n">_</span><span class="p">,</span> <span class="n">modedir</span> <span class="k">in</span> <span class="nb">ipairs</span><span class="p">(</span><span class="n">modedirs</span><span class="p">)</span> <span class="k">do</span>
                
                <span class="c1">-- get mode</span>
                <span class="kd">local</span> <span class="n">mode</span> <span class="o">=</span> <span class="n">path</span><span class="p">.</span><span class="n">basename</span><span class="p">(</span><span class="n">modedir</span><span class="p">)</span>

                <span class="c1">-- make lipo arguments</span>
                <span class="kd">local</span> <span class="n">lipoargs</span> <span class="o">=</span> <span class="kc">nil</span>
                <span class="k">for</span> <span class="n">_</span><span class="p">,</span> <span class="n">arch</span> <span class="k">in</span> <span class="nb">ipairs</span><span class="p">(</span><span class="n">platform</span><span class="p">.</span><span class="n">archs</span><span class="p">(</span><span class="n">plat</span><span class="p">))</span> <span class="k">do</span>
                    <span class="kd">local</span> <span class="n">archfile</span> <span class="o">=</span> <span class="n">format</span><span class="p">(</span><span class="s2">"%s/%s.pkg/lib/%s/%s/%s/%s"</span><span class="p">,</span> <span class="n">outputdir</span><span class="p">,</span> <span class="n">target</span><span class="p">:</span><span class="n">name</span><span class="p">(),</span> <span class="n">mode</span><span class="p">,</span> <span class="n">plat</span><span class="p">,</span> <span class="n">arch</span><span class="p">,</span> <span class="n">path</span><span class="p">.</span><span class="n">filename</span><span class="p">(</span><span class="n">target</span><span class="p">:</span><span class="n">targetfile</span><span class="p">()))</span> 
                    <span class="k">if</span> <span class="n">os</span><span class="p">.</span><span class="n">isfile</span><span class="p">(</span><span class="n">archfile</span><span class="p">)</span> <span class="k">then</span>
                        <span class="n">lipoargs</span> <span class="o">=</span> <span class="n">format</span><span class="p">(</span><span class="s2">"%s -arch %s %s"</span><span class="p">,</span> <span class="n">lipoargs</span> <span class="ow">or</span> <span class="s2">""</span><span class="p">,</span> <span class="n">arch</span><span class="p">,</span> <span class="n">archfile</span><span class="p">)</span> 
                    <span class="k">end</span>
                <span class="k">end</span>
                <span class="k">if</span> <span class="n">lipoargs</span> <span class="k">then</span>

                    <span class="c1">-- make full lipo arguments</span>
                    <span class="n">lipoargs</span> <span class="o">=</span> <span class="n">format</span><span class="p">(</span><span class="s2">"-create %s -output %s/%s.pkg/lib/%s/%s/universal/%s"</span><span class="p">,</span> <span class="n">lipoargs</span><span class="p">,</span> <span class="n">outputdir</span><span class="p">,</span> <span class="n">target</span><span class="p">:</span><span class="n">name</span><span class="p">(),</span> <span class="n">mode</span><span class="p">,</span> <span class="n">plat</span><span class="p">,</span> <span class="n">path</span><span class="p">.</span><span class="n">filename</span><span class="p">(</span><span class="n">target</span><span class="p">:</span><span class="n">targetfile</span><span class="p">()))</span>

                    <span class="c1">-- make universal directory</span>
                    <span class="n">os</span><span class="p">.</span><span class="n">mkdir</span><span class="p">(</span><span class="n">format</span><span class="p">(</span><span class="s2">"%s/%s.pkg/lib/%s/%s/universal"</span><span class="p">,</span> <span class="n">outputdir</span><span class="p">,</span> <span class="n">target</span><span class="p">:</span><span class="n">name</span><span class="p">(),</span> <span class="n">mode</span><span class="p">,</span> <span class="n">plat</span><span class="p">))</span>

                    <span class="c1">-- package all archs</span>
                    <span class="n">os</span><span class="p">.</span><span class="n">execv</span><span class="p">(</span><span class="s2">"xmake"</span><span class="p">,</span> <span class="p">{</span><span class="s2">"l"</span><span class="p">,</span> <span class="s2">"lipo"</span><span class="p">,</span> <span class="n">lipoargs</span><span class="p">})</span>
                <span class="k">end</span>
            <span class="k">end</span>
        <span class="k">end</span>
    <span class="k">end</span>
<span class="k">end</span>
</code></pre>
</div>

<p class="tip">
    If you want to known more options, please run: `xmake macro --help`
</p>

<h4 id="run-the-custom-lua-script">Run the Custom Lua Script</h4>

<h5 id="run-the-given-script">Run the given script</h5>

<p>Write a simple lua script:</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="k">function</span> <span class="nf">main</span><span class="p">()</span>
    <span class="nb">print</span><span class="p">(</span><span class="s2">"hello xmake!"</span><span class="p">)</span>
<span class="k">end</span>
</code></pre>
</div>

<p>Run this lua script.</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake lua /tmp/test.lua
</code></pre>
</div>

<p class="tip">
    You can also use `import` api to write a more advance lua script. 
</p>

<h5 id="run-the-builtin-script">Run the builtin script</h5>

<p>You can run <code class="highlighter-rouge">xmake lua -l</code> to list all builtin script name, for example:</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake lua -l
scripts:
    cat
    cp
    <span class="nb">echo
    </span>versioninfo
    ...
</code></pre>
</div>

<p>And run them:</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake lua cat ~/file.txt
<span class="gp">$ </span>xmake lua <span class="nb">echo</span> <span class="s2">"hello xmake"</span>
<span class="gp">$ </span>xmake lua cp /tmp/file /tmp/file2
<span class="gp">$ </span>xmake lua versioninfo
</code></pre>
</div>

<h5 id="run-interactive-commands-repl">Run interactive commands (REPL)</h5>

<p>Enter interactive mode:</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake lua
<span class="gp">&gt; </span>1 + 2
3

<span class="gp">&gt; </span>a <span class="o">=</span> 1
<span class="gp">&gt; </span>a
1

<span class="gp">&gt; </span><span class="k">for </span>_, v <span class="k">in </span>pairs<span class="o">({</span>1, 2, 3<span class="o">})</span> <span class="k">do</span>
<span class="gp">&gt;&gt; </span>print<span class="o">(</span>v<span class="o">)</span>
<span class="gp">&gt;&gt; </span>end
1
2
3
</code></pre>
</div>

<p>And we can <code class="highlighter-rouge">import</code> modules:</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">&gt; </span>task <span class="o">=</span> import<span class="o">(</span><span class="s2">"core.project.task"</span><span class="o">)</span>
<span class="gp">&gt; </span>task.run<span class="o">(</span><span class="s2">"hello"</span><span class="o">)</span>
hello xmake!
</code></pre>
</div>

<p>If you want to cancel multiline input, please input character <code class="highlighter-rouge">q</code>, for example:</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">&gt; </span><span class="k">for </span>_, v <span class="k">in </span>ipairs<span class="o">({</span>1, 2<span class="o">})</span> <span class="k">do</span>
<span class="gp">&gt;&gt; </span>print<span class="o">(</span>v<span class="o">)</span>
<span class="gp">&gt;&gt; </span>q             &lt;--  cancel multiline and clear previous input
<span class="gp">&gt; </span>1 + 2
3
</code></pre>
</div>

<h4 id="generate-ide-project-files">Generate IDE Project Files</h4>

<h5 id="generate-makefile">Generate Makefile</h5>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake project -k makefile
</code></pre>
</div>

<h5 id="generate-compiler_commands">Generate compiler_commands</h5>

<p>We can export the compilation commands info of all source files and it is JSON compilation database format.</p>

<div class="language-console highlighter-rouge"><pre class="highlight"><code><span class="w">$ </span><span class="nc">xmake</span><span class="kv"> project -k compile_commands
</span></code></pre>
</div>

<p>The the content of the output file:</p>

<div class="highlighter-rouge"><pre class="highlight"><code>[
  { "directory": "/home/user/llvm/build",
    "command": "/usr/bin/clang++ -Irelative -DSOMEDEF=\"With spaces, quotes and \\-es.\" -c -o file.o file.cc",
    "file": "file.cc" },
  ...
]

</code></pre>
</div>

<p>Please see <a href="#https://clang.llvm.org/docs/JSONCompilationDatabase.html">JSONCompilationDatabase</a> if need known more info about <code class="highlighter-rouge">compile_commands</code>.</p>

<h5 id="generate-visualstudio-project">Generate VisualStudio Project</h5>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake project -k <span class="o">[</span>vs2008|vs2013|vs2015|..]
</code></pre>
</div>

<p>v2.1.2 or later, it supports multi-mode and multi-architecture generation for vs201x project.</p>

<p>For example:</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake project -k vs2017 -m <span class="s2">"debug,release"</span>
</code></pre>
</div>

<p>It will generate four project configurations: <code class="highlighter-rouge">debug|x86</code>, <code class="highlighter-rouge">debug|x64</code>, <code class="highlighter-rouge">release|x86</code>, <code class="highlighter-rouge">release|x64</code>.</p>

<p>Or you can set modes to <code class="highlighter-rouge">xmake.lua</code>:</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">set_modes</span><span class="p">(</span><span class="s2">"debug"</span><span class="p">,</span> <span class="s2">"release"</span><span class="p">)</span>
</code></pre>
</div>

<p>Then, we run the following command:</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake project -k vs2017
</code></pre>
</div>

<p>The effect is same.</p>

<h4 id="generate-doxygen-document">Generate Doxygen Document</h4>

<p>Please ensure that the doxygen tool has been installed first.</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake doxygen
</code></pre>
</div>

<h2 id="more-plugins">More Plugins</h2>

<p>Please download and install from the plugins repository <a href="https://github.com/xmake-io/xmake-plugins">xmake-plugins</a>.</p>

<h4 id="convert-app-to-ipa">Convert .app to .ipa</h4>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake app2ipa --icon<span class="o">=</span>/xxx.png /xxx/ios.app -o /xxx.ios.ipa
</code></pre>
</div>

        </article>
        <hr>

        <!-- baidu ads -->
        

        
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
                    
                    <h2 id="chinese">中文</h2>
                    <ul>
                    
                    <li class="relatedPost">
                        <a href="/cn/docs/xmake/plugins/">插件开发
                        
                        </a>
                    </li>
                    
                    
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
        
            </ul>
        

        
        
            
            
            
                
                    
                        
                        <h2 id="similar_posts">Similar Posts</h2>
                        <ul>
                        
                        <li class="relatedPost">
                            <a href="/2021/12/17/xmake-update-v2.6.2/">Xmake v2.6.2 released, Support building Linux kernel driver module
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/2021/12/03/xmake-update-v2.6.1/">xmake v2.6.1 released, Switch to Lua5.4 runtime, Support Rust and C++ mixed compilation
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/2021/10/30/xmake-update-v2.5.9/">xmake v2.5.9 released, Improve C++20 Modules and support Nim, Keil MDK and Unity Build
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/2021/10/08/xmake-update-v2.5.8/">xmake v2.5.8 is released, Support Pascal/Swig program and Lua53 runtime
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/2021/08/29/xmake-update-v2.5.7/">xmake v2.5.7 released, Use lockfile to freeze package dependencies and Vala/Metal language support
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
            
            
        
            
        
        
            </ul>
        

        <div class="post-recent">
    <div class="pre">

        

        

        
        
        

        

        

        
        
        <p><strong>Prev Post</strong> <a href="/docs/xmake/manual/">Api Manual</a></p>
        
    </div>

    <div class="nex">

        

        

        
        
        

        

        

        
        
        <p><strong>Next Post</strong> <a href="/2016/01/30/welcome/">Welcome to TBOOX!</a></p>
        
    </div>
</div>


        <h2 id="comments">Comments</h2>
        






<div id="gitalk-container"></div>
<link rel="stylesheet" href="/css/gitalk.css">
<script src="/js/gitalk.min.js"></script>

<script>
const gitalk = new Gitalk({
  clientID: '73946dc1d9e2276ad0da',
  clientSecret: '12a3cb94361ba3ebc6ecb68cf80d592bfaa8106d',
  repo: 'tboox.github.io',
  owner: 'waruqi',
  admin: ['waruqi'],
  id: location.pathname,      
  language: 'en',
  distractionFreeMode: false  
})

gitalk.render('gitalk-container')
</script>





    </div>
    <button class="anchor"><i class="fa fa-anchor"></i></button>
    <div class="right">
        <div class="wrap">


            <!-- codefund ads -->
            

            <!-- Content -->
            <div class="side content">
                <div>
                    Content
                </div>
                <ul id="content-side" class="content-ul">
                    <li><a href="#chinese">中文</a></li>
                    <li><a href="#similar_posts">Similar Posts</a></li>
                    <li><a href="#comments">Comments</a></li>
                </ul>
            </div>

            <!-- baidu ads -->
            

            <br>
            <div class="side">
                <div>
                    <i class="fa fa-external-link"></i>
                    Links
                </div>
                <ul class="content-ul">
                  <li><a href="http://github.com/waruqi/tbox">tbox</a></li>
                  <li><a href="http://www.xmake.io">xmake</a></li>
                  <li><a href="https://github.com/waruqi">github</a></li>
                </ul>
            </div> 

            <!-- google ads -->
            

            <!-- baidu ads -->
            

            <!-- chitika ads -->
            
        </div>
    </div>

    <!-- baidu ads -->
    
</div>
<script>
/**
 * target _blank
 */
(function() {
    var aTags = document.querySelectorAll('article a:not([id])')
    for (var i = 0; i < aTags.length; i++) {
        aTags[i].setAttribute('target', '_blank')
    }
}());
</script>
<script src="/js/pageContent.js " charset="utf-8"></script>



    <footer class="site-footer">
    <div class="wrapper">
        <p class="description">
             Copyright (c) 2016-2020 tboox.org 
        </p>
        <p class="contact">
            
            <a href="https://github.com/waruqi" title="GitHub"><i class="fa fa-github" aria-hidden="true"></i></a> 
             
            
            <a href="mailto:waruqi@gmail.com" title="email"><i class="fa fa-envelope-o" aria-hidden="true"></i></a> 
            
            
            <a href="https://twitter.com/waruqi" title="Twitter"><i class="fa fa-twitter" aria-hidden="true"></i></a> 
            
            <a href="/feed.xml" title="feed"><i class="fa fa-feed" aria-hidden="true"></i></a> 
        </p>
        <p class="power">
            <span>
                Site powered by <a href="https://jekyllrb.com/">Jekyll</a> & <a href="https://github.com/Gaohaoyang">HyG</a> & <a href="https://pages.github.com/">Github Pages</a>.
            </span>
        </p>
    </div>
</footer>

    <div class="back-to-top">
    <a href="#top" class="scroll">
        <i class="fa fa-arrow-up" aria-hidden="true"></i>
    </a>
</div>

    <script src=" /js/main.js " charset="utf-8"></script>
    <script src=" /js/scroll.min.js " charset="utf-8"></script>
  </body>

</html>
